<?php
	
//------------------------------------------------------------------
// File: dataAccess.php
// Author: Bryan Frost
// Date Created: 2010-03-25
//
// Database Management
//------------------------------------------------------------------


// TODO: Convert to object oriented db connection.

echo '<ol>';
$hash_algos_arr = hash_algos();
$hash_algos_len = array_count_values($hash_algos_arr);
for ( $i = 0; $i < $hash_algos_len; $i++ )
{
    echo '<li>'.$hash_algos_arr[$i].'</li>';
}

echo '</ol>';

// Define database connection constants
define('DB_HOST', localhost);
define('DB_USER', 'phillipv_user1');
define('DB_PASSWORD', 'pas');
define('DB_NAME', 'phillipv_AVA');

/*define('DB_HOST', 'prometheus.za-dns.com');
define('DB_USER', 'daleclar_user');
define('DB_PASSWORD', 'DCdbuserDfend3r');
define('DB_NAME', 'daleclar_general');*/

define('CURRENT_SEASON', '2010');

function GetConnection()
{
	$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
		or die('Error connecting to MySQL server.');
	
	return $dbc;
}



// Generic query function.
function GetQueryResult($query)
{
	$dbc = GetConnection();
	$result = mysqli_query($dbc,$query);
//		or die("Error querying MySQL server.");
	mysqli_close($dbc);
	
	return $result;
}

?>